<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of sfTCPDFDocumentVenteAchat
 *
 * @author MEDIA CITY
 */
class sfTCPDFDocumentStock extends sfTCPDF {
    public function setHeaderData($ref='', $code = '', $raisonSociale = '',$magasinier = '', $matricule_fiscale = '', $date = '', $ln = '', $lw = 0, $ht = '', $hs = '', $tc = array(0, 0, 0), $lc = array(0, 0, 0)) {
        parent::setHeaderData($ln, $lw, $ht, $hs, $tc, $lc);
        $this->header_ref = $ref;
        $this->header_code = $code;
        $this->header_raison_social = $raisonSociale;
        $this->header_telephone1 = $telephone1;
        $this->header_telephone2 = $telephone2;
        $this->header_matricule_fiscale = $matricule_fiscale;
        $this->header_magasiner = $magasinier;
        $this->header_matricule_fiscale = $matricule_fiscale;
        $this->header_date = $date;
    }

    public function Header() {
        $html = '<table border="" cellspacing="3" cellpadding="4">
                        <tr>
                            <th align="centre" style="font-weight: bold">'.$this->header_ref.'</th>
                        </tr>
                    </table>';
//        $this->writeHTMLCell(190, 20, 10, 30, $html, 0, 0, 0, true, '', true);
        $this->SetFont('courier', 'B', 14, '', true);
        $this->SetLineStyle(array('width' => 0.3, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));
        $this->RoundedRect(10, 40, 120, 32, 3.50, '1111');
        $this->RoundedRect(135, 40, 65, 32, 3.50, '1111');
        $this->RoundedRect(10, 75, 190, 202, 3.50, '1111');
        $this->SetFillColor(255, 255, 255);
        $style = array('width' => 0.05, 'cap' => 'butt', 'join' => 'miter', 'dash' => '1,1,1,1', 'phase' => 10, 'color' => array(0, 0, 0));
        $this->SetFont('courier', 'B', 11, '', true);
        $this->ln(2);
        $this->cell(0);


$this->writeHTMLCell(190, 20, 10, 30, $html, 0, 0, 0, true, '', true);
$html = '<table   cellpadding="1">
                  <tr>
                         <td style="width:75%;">
                             <table >
                                    <tr>
                                         <td >Code Client :' . $this->header_code . '</td> 
                                    </tr>
                                    <tr>
                                         <td>Client :' . $this->header_raison_social . '</td> 
                                    </tr>
                                     
                                    <tr>
                                         <td>M.F :' . $this->header_matricule_fiscale . '</td> 
                                    </tr>
                                    <tr>
                                         <td >Magasiner : ' . $this->header_magasiner.'</td>
                                    </tr>
                                    
                             </table>
                         </td>
                         <td>
                             <table >
                                   <tr>
                                       <td height="25"></td>
                                   </tr>
                                   <tr>
                                        <td align="middle" height="30" style="padding:10">Date : ' . dates::dateForm($this->header_date) . '</td>
                                   </tr>
                                   <tr>
                                        <td height="20"></td>
                                   </tr>
                                   <tr>
                                        <td align="middle" height="20">Page : '.$this->getAliasNumPage().'/'.$this->getAliasNbPages().'</td>
                                   </tr>
                             </table>
                         </td>
                   </tr>
           </table>';
        $this->writeHTMLCell(180, 32, 10, 40, $html, 0, 0, 0, true, '', true);
        $html = '<table  style="font-size:30px">
                  
                  <tr >
                      <td align="contre" height="20" style="width: 10%;border-bottom: 1px solid #000000;border-right: 0.5px dotted #000000;">Réf.</td>
                      <td align="contre" style="width: 75%;border-bottom: 1px solid #000000;border-right: 0.5px dotted #000000;">Désignation</td>
                      <td align="contre" style="width: 15%;border-bottom: 1px solid #000000;">Qte</td>
                  </tr>
                  </table>';
        $this->writeHTMLCell(190, 32, 10, 75, $html, 0, 0, 0, true, '', true);
        parent::Header();
//        $this->printTemplate(50, 20, 0, 0, 0, '', '', false);
    }

}

?>
